import React from 'react';
import {HashRouter as Router, Route, Switch} from "react-router-dom";
import App from './App';
import Admin from "./Admin";
import Login from "./pages/login";
import Buttons from "./pages/ui/button";
import NotMatch from "./pages/not-match";
import Modals from "./pages/ui/modals";
import Loadings from "./pages/ui/loadings";
import Notice from "./pages/ui/notice";
import Message from "./pages/ui/messages";
import Tab from "./pages/ui/tabs";
import FormLogin from "./pages/form/login";
import Markdown from "./pages/markdown";

export default class AdminRouter extends React.Component {

  render(){
    return (
      <Router>
        <App>
          <Route path='/login' component={Login} />
          <Route path='/admin' render={() =>
            <Admin>
              <Switch>
                <Route exact path='/admin/ui/buttons' component={Buttons} />
                <Route exact path='/admin/ui/modals' component={Modals} />
                <Route exact path='/admin/ui/loadings' component={Loadings} />
                <Route exact path='/admin/ui/notification' component={Notice} />
                <Route exact path='/admin/ui/messages' component={Message} />
                <Route exact path='/admin/ui/tabs' component={Tab} />
                <Route exact path='/admin/form/login' component={FormLogin} />
                <Route exact path='/admin/markdown' component={Markdown} />
                <Route component={NotMatch} />
              </Switch>
            </Admin>
          } />
        </App>
      </Router>
    );
  }
}